@import '../../styles/themes/index';

.loop-grid-columns(@index, @class) when (@index > 0) {
  .@{rk-prefix}-flexitem@{class}--@{index} {
    display: block;
    flex: 0 0 percentage((@index / @grid-columns));
    max-width: percentage((@index / @grid-columns));
  }
  .loop-grid-columns((@index - 1), @class);
}

.loop-grid-columns(@index, @class) when (@index = 0) {
  .@{rk-prefix}-flexitem@{class}--@{index} {
    display: none;
  }
}

.make-grid(@class: ~'') {
  .loop-grid-columns(@grid-columns, @class);
}
